
  /* 按鈕樣式 */
  #loadMoreBtn {
    margin-top: 20px;
    padding: 8px 16px;
    font-size: 16px;
    cursor: pointer;
  }

/* 黑暗模式樣式 */
.dark-mode {
  background-color: #121212; /* 深灰色背景 */
  color: #F0F0F0; /* 柔和的淺灰色文字 */
}
/* 黑暗模式下為頂部導航添加背景色 */
.dark-mode .topnav {
    background-color: #222222; /* 稍淺的深灰色導航欄背景 */
  }
  
  .dark-mode .topnav a {
    color: #F0F0F0; /* 導航連結文字顏色 */
  }
  
  .dark-mode .topnav a:hover {
    background-color: #555555; /* 導航連結 hover 背景色 */
    color: #ffffff; /* 導航連結 hover 文字顏色 */
  }
  
  .dark-mode .topnav a.active {
    background-color: #5A67D8; /* Active 狀態的強調色 (柔和藍紫色) */
    color: white;
  }
  
  .dark-mode button {
    background-color: #5A67D8; /* 柔和的藍紫色按鈕背景 */
    color: #FFFFFF; /* 按鈕文字顏色 */
  }
  
  .dark-mode button:hover {
    opacity: 0.8; /* 按鈕 hover 透明度 */
  }
  
  .dark-mode .copyBtn {
    background-color: #374151; /* 深藍灰色複製按鈕背景 */
    color: #E5E7EB; /* 複製按鈕文字顏色 */
  }

  .dark-mode .page {
    background: rgb(185, 185, 185);
    }
  
    .dark-mode .toc {
        background-color: rgb(180, 180, 180);
    }

  /* 為頂部導航添加黑色背景色 */
  .topnav {
      background-color: #333;
      overflow: hidden;
    }
    
    /* 設定導覽列中連結的樣式 */
    .topnav a {
      float: left;
      display: block;
      color: #f2f2f2;
      text-align: center;
      padding: 14px 16px;
      text-decoration: none;
      font-size: 17px;
    }
    
    /* 更改懸停時連結的顏色 */
    .topnav a:hover {
      background-color: #ddd;
      color: black;
    }
    
    /* 新增一個活動類別來突出顯示目前頁面 */
    .topnav a.active {
      background-color: #04AA6D;
      color: white;
    }
    
    /* 隱藏應在小屏幕上打開和關閉頂部導航的鏈接 */
    .topnav .icon {
      display: none;
    }
    
    @media screen and (max-width: 600px) {
      .topnav a:not(:first-child) {display: none;}
      .topnav a.icon {
        float: right;
        display: block;
      }
    }
    
    @media screen and (max-width: 600px) {
      .topnav.responsive {position: relative;}
      .topnav.responsive .icon {
        position: absolute;
        right: 0;
        top: 0;
      }
      .topnav.responsive a {
        float: none;
        display: block;
        text-align: left;
      }
    }
  
    button {
      background-color: #04AA6D;
      color: white;
      padding: 14px 20px;
      margin: 8px 0;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      width: 50%;
      font-size: 16px;
  }
  
  
  button:hover {
      opacity: 0.8;
  }
  
  footer {
    background-color: #222;
    font-size: 14px;
    color: white;
    text-align: center;
    padding: 5px;
    /*position: fixed; /* 固定位置 */
    left: 0;       /* 左邊緣對齊 */
    bottom: 0;     /* 底部對齊 */
    width: 100%;   /* 撐滿整個頁面的寬度 */
  }
  
  
  #date5 {
      position: fixed;
      top: 55px;
      right: 5px;
      font-size: 1.2rem;
      background: rgba(0, 0, 0, 0.8);
      color: #fff;
      padding: 5px 10px;
      border-radius: 5px;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
      z-index: 2;
  }
  @media (max-width: 600px) {
      #date5 {
          top: 55px;
          font-size: 0.8rem;
      }
  }
  
  #clock5 {
      position: fixed;
      top: 96px;
      right: 5px;
      font-size: 1.2rem;
      background: rgba(0, 0, 0, 0.8);
      color: #fff;
      padding: 5px 10px;
      border-radius: 5px;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
      z-index: 2
  }
  @media (max-width: 600px) {
      #clock5 {
          top: 85px;
          font-size: 0.8rem;
      }
  }
  
  /* 預設情況下隱藏手機內容 */
  .mobile-content {
    display: none;
  }
  
  /* 當螢幕寬度小於768px時，顯示手機內容，隱藏桌面內容 */
  @media (max-width: 600px) {
    .desktop-content {
        display: none;
    }
  
    .mobile-content {
        display: block;
    }
  }
  
  /* 切換開關容器 */
  .toggle-container {
    position: fixed;   /* 固定定位，會依照視窗位置 */
    top: 137px;         /* 距離上方 137px */
    right: 15px;          /* 靠右顯示 */
    display: inline-block;
    width: 60px;
    height: 34px;
    cursor: pointer;
    z-index: 2
  }
  @media (max-width: 600px) {
    .toggle-container {
      top: 100px; 
    }
    }
  
  /* 隱藏真正的 checkbox */
  .toggle-container input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  
  /* Slider 外框 */
  .slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: background-color 0.4s;
    border-radius: 34px;
  }
  
  /* Slider 上的小圓球 */
  .slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: #fff;
    transition: transform 0.4s;
    border-radius: 50%;
  }
  
  /* 當 checkbox 被勾選時改變背景顏色 */
  input:checked + .slider {
    background-color: #4d4d4d;
  }
  
  /* 當勾選時移動小圓球 */
  input:checked + .slider:before {
    transform: translateX(26px);
  }
  
  /* 太陽與月亮圖示樣式 */
  .slider .icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    fill: #f39c12;
    transition: opacity 0.4s;
  }
  
  /* 太陽圖示置左 */
  .slider .icon.sun {
    left: 6px;
    opacity: 1;
  }
  
  /* 勾選時隱藏太陽圖示 */
  input:checked + .slider .icon.sun {
    opacity: 0;
  }
  
  /* 月亮圖示置右 */
  .slider .icon.moon {
    right: 6px;
    opacity: 0;
    fill: #f1c40f;
  }
  
  /* 勾選時顯示月亮圖示 */
  input:checked + .slider .icon.moon {
    opacity: 1;
  }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Microsoft JhengHei', Arial, sans-serif;
            background-color: #f5f5f5;
            color: #333;
            line-height: 1.6;
            overflow-x: hidden;
            text-align: center;
        }

        .ebook-container {
            max-width: 800px;
            margin: 20px auto;
            position: relative;
            perspective: 1500px;
            padding-left: 50px; /* 為左側按鈕預留空間 */
            padding-right: 50px; /* 為右側按鈕預留空間 */
        }

        .ebook {
            position: relative;
            width: 100%;
            height: 600px;
            transform-style: preserve-3d;
        }

        .page {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            background: white;
            padding: 30px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
            overflow-y: auto;
            backface-visibility: hidden;
            transform-origin: left center;
            transform-style: preserve-3d;
            transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.6s ease;
            will-change: transform, box-shadow;
            z-index: 1;
        }

        .page.right {
            transform: rotateY(0deg) translateZ(0);
            box-shadow: 5px 0 15px rgba(0,0,0,0.2);
        }

        .page.left {
            transform: rotateY(-180deg) translateZ(0);
            box-shadow: -5px 0 15px rgba(0,0,0,0.2);
        }

        .page.active {
            z-index: 2;
        }

        .page.turning-next {
            transform: rotateY(-180deg) translateZ(1px);
            box-shadow: -10px 0 20px rgba(0,0,0,0.3);
            z-index: 3;
        }

        .page.turning-prev {
            transform: rotateY(0deg) translateZ(1px);
            box-shadow: 10px 0 20px rgba(0,0,0,0.3);
            z-index: 3;
        }

        .chapter-start {
            page-break-before: always;
        }

        h1, h2, h3 {
            color: #2c3e50;
            margin-bottom: 15px;
        }

        h1 {
            font-size: 2.2em;
            text-align: center;
            margin: 20px 0 40px;
            border-bottom: 2px solid #3498db;
            padding-bottom: 10px;
        }

        h2 {
            font-size: 1.8em;
            margin-top: 30px;
            border-left: 5px solid #3498db;
            padding-left: 15px;
        }

        p {
            margin-bottom: 15px;
            text-align: justify;
        }

        .toc {
            background-color: #f9f9f9;
            padding: 20px;
            border-radius: 5px;
            margin: 20px 0;
        }

        .toc ul {
            list-style-type: none;
        }

        .toc li {
            margin: 10px 0;
            padding-left: 20px;
            position: relative;
        }

        .toc li:before {
            content: "→";
            position: absolute;
            left: 0;
            color: #3498db;
        }

        .toc a {
            color: #3498db;
            text-decoration: none;
            transition: color 0.3s;
        }

        .toc a:hover {
            color: #2980b9;
            text-decoration: underline;
        }

        .nav-buttons {
            text-align: center;
            margin-top: 20px;
        }

        .nav-buttons button {
            padding: 8px 15px;
            background-color: #3498db;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
            margin: 0 10px;
            transition: background-color 0.3s;
        }

        .nav-buttons button:hover {
            background-color: #2980b9;
        }

        .fixed-nav {
            position: fixed;
            top: 50%;
            transform: translateY(-50%);
            z-index: 10;
        }

        .fixed-nav.prev {
            left: 0; /* 靠左邊緣 */
            transform: translateX(-100%) translateY(-50%); /* 移到 .ebook-container 左側 */
        }

        .fixed-nav.next {
            right: 0; /* 靠右邊緣 */
            transform: translateX(100%) translateY(-50%); /* 移到 .ebook-container 右側 */
        }

        .fixed-nav button {
            width: 40px;
            height: 40px;
            background-color: #3498db;
            border: none;
            border-radius: 50%;
            font-size: 20px;
            color: white;
            cursor: pointer;
            position: relative;
            transition: background-color 0.3s;
        }

        .fixed-nav button:hover {
            background-color: #2980b9;
        }

        .fixed-nav button:disabled {
            background-color: #95a5a6;
            cursor: not-allowed;
        }

        .fixed-nav button::after {
            content: attr(data-tooltip);
            position: absolute;
            background-color: #333;
            color: white;
            padding: 5px 10px;
            border-radius: 3px;
            font-size: 12px;
            white-space: nowrap;
            opacity: 0;
            transition: opacity 0.3s;
            pointer-events: none;
        }

        .fixed-nav.prev button::after {
            right: -60px; /* 調整提示文字位置 */
            top: 50%;
            transform: translateY(-50%);
        }

        .fixed-nav.next button::after {
            left: -60px; /* 調整提示文字位置 */
            top: 50%;
            transform: translateY(-50%);
        }

        .fixed-nav button:hover::after {
            opacity: 1;
        }

        .page-number {
            text-align: center;
            margin-top: 10px;
            color: #7f8c8d;
        }

        /* 新增的固定回目錄按鈕樣式 */
        .fixed-toc-btn {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 10;
        }

        .fixed-toc-btn {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 50px; /* 設定高度以確保按鈕內文字能對齊 */
        }
        
        .fixed-toc-btn button {
            background-color: #e74c3c; /* 紅色，更醒目 */
            color: white;
            border: none;
            border-radius: 25px;
            cursor: pointer;
            font-size: 16px;
            transition: background-color 0.3s;
            position: relative;
            overflow: hidden;
            width: 125px; /* 設定固定寬度，確保動畫效果一致 */
            text-align: center;
        }

        .fixed-toc-btn button:hover {
            background-color: #c0392b;
        }

        @media (max-width: 768px) {
            .ebook {
                height: 500px;
            }

            .page {
                padding: 20px;
            }

            .fixed-nav.prev {
                left: 5px;
                transform: translateX(-80%) translateY(-50%); /* 調整小螢幕上的位置 */
            }

            .fixed-nav.next {
                right: 5px;
                transform: translateX(80%) translateY(-50%); /* 調整小螢幕上的位置 */
            }

            .fixed-nav button {
                width: 30px;
                height: 30px;
                font-size: 16px;
            }

            .fixed-nav.prev button::after,
            .fixed-nav.next button::after {
                display: none; /* 手機螢幕空間有限，移除提示 */
            }

            .fixed-toc-btn button {
                font-size: 14px;
                padding: 8px 16px;
            }

            .ebook-container {
                padding-left: 40px; /* 為左側按鈕預留空間 */
                padding-right: 40px; /* 為右側按鈕預留空間 */
            }
        }